Skip to content

Commit 17d6a0c

Browse files
committed
Fix python 2 assertion
1 parent 934b104 commit 17d6a0c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/test_git.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pytest
1010

1111
from libvcs import exc
12-
from libvcs._compat import string_types
12+
from libvcs._compat import PY2, string_types
1313
from libvcs.git import GitRemote, GitRepo, extract_status
1414
from libvcs.shortcuts import create_repo_from_pip_url
1515
from libvcs.util import run, which
@@ -285,12 +285,19 @@ def test_extract_status():
285285
],
286286
[
287287
'# branch.upstream moo/origin/myslash/remote',
288-
{"branch_upstream": 'moo/origin/myslash/remote',},
288+
{"branch_upstream": 'moo/origin/myslash/remote'},
289289
],
290290
],
291291
)
292292
def test_extract_status_b(fixture, expected_result):
293-
assert expected_result.items() <= extract_status(textwrap.dedent(fixture)).items()
293+
if PY2:
294+
assert (
295+
extract_status(textwrap.dedent(fixture)).items() <= expected_result.items()
296+
)
297+
else:
298+
assert (
299+
extract_status(textwrap.dedent(fixture)).items() >= expected_result.items()
300+
)
294301

295302

296303
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)