Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sdispater committed Jan 13, 2019
1 parent c640aaf commit 2949e15
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 3 additions & 5 deletions poetry/puzzle/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
import os
import pkginfo
import re
import shutil
import time

from cleo import ProgressIndicator
from contextlib import contextmanager
from tempfile import mkdtemp
from typing import List

from poetry.io import NullIO

from poetry.packages import Dependency
from poetry.packages import DependencyPackage
from poetry.packages import DirectoryDependency
Expand All @@ -31,6 +28,7 @@

from poetry.utils._compat import PY35
from poetry.utils._compat import Path
from poetry.utils._compat import OrderedDict
from poetry.utils.helpers import parse_requires
from poetry.utils.helpers import safe_rmtree
from poetry.utils.env import Env
Expand Down Expand Up @@ -491,7 +489,7 @@ def complete_package(
# An example of this is:
# - pypiwin32 (220); sys_platform == "win32" and python_version >= "3.6"
# - pypiwin32 (219); sys_platform == "win32" and python_version < "3.6"
duplicates = {}
duplicates = OrderedDict()
for dep in dependencies:
if dep.name not in duplicates:
duplicates[dep.name] = []
Expand All @@ -507,7 +505,7 @@ def complete_package(
self.debug("<debug>Duplicate dependencies for {}</debug>".format(dep_name))

# Regrouping by constraint
by_constraint = {}
by_constraint = OrderedDict()
for dep in deps:
if dep.constraint not in by_constraint:
by_constraint[dep.constraint] = []
Expand Down
6 changes: 6 additions & 0 deletions poetry/utils/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
from pathlib2 import Path


if not PY36:
from collections import OrderedDict
else:
OrderedDict = dict


def decode(string, encodings=None):
if not PY2 and not isinstance(string, bytes):
return string
Expand Down
4 changes: 4 additions & 0 deletions tests/mixology/version_solver/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import pytest


pytest.register_assert_rewrite("tests.mixology.helpers")

0 comments on commit 2949e15

Please sign in to comment.