From ad974199ff8312f9b617a26a8295fe43a05fc16a Mon Sep 17 00:00:00 2001 From: Victor Tso Date: Thu, 15 Oct 2020 08:51:45 -0500 Subject: [PATCH] lint --- poetry/core/factory.py | 4 +++- tests/masonry/test_api.py | 30 ++++++++++++++++++------------ tests/test_factory.py | 8 ++++---- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/poetry/core/factory.py b/poetry/core/factory.py index 23e02f8f2..d248dbb74 100644 --- a/poetry/core/factory.py +++ b/poetry/core/factory.py @@ -27,7 +27,9 @@ class Factory(object): Factory class to create various elements needed by Poetry. """ - def create_poetry(self, cwd=None, with_dev=True): # type: (Optional[Path]. bool) -> Poetry + def create_poetry( + self, cwd=None, with_dev=True + ): # type: (Optional[Path]. bool) -> Poetry poetry_file = self.locate(cwd) local_config = PyProjectTOML(path=poetry_file).poetry_config diff --git a/tests/masonry/test_api.py b/tests/masonry/test_api.py index 47d0be2e3..8b4261e8a 100644 --- a/tests/masonry/test_api.py +++ b/tests/masonry/test_api.py @@ -66,14 +66,16 @@ def test_build_wheel_with_include(): def test_build_wheel_with_bad_path_dev_dep_succeeds(): - with temporary_directory() as tmp_dir, cwd(os.path.join(fixtures, "with_bad_path_dev_dep")): + with temporary_directory() as tmp_dir, cwd( + os.path.join(fixtures, "with_bad_path_dev_dep") + ): api.build_wheel(tmp_dir) def test_build_wheel_with_bad_path_dep_fails(): - with pytest.raises(ValueError) as err,\ - temporary_directory() as tmp_dir, \ - cwd(os.path.join(fixtures, "with_bad_path_dep")): + with pytest.raises(ValueError) as err,temporary_directory() as tmp_dir, cwd( + os.path.join(fixtures, "with_bad_path_dep") + ): api.build_wheel(tmp_dir) assert "../only/in/dev" in str(err.value) @@ -115,14 +117,16 @@ def test_build_sdist_with_include(): def test_build_sdist_with_bad_path_dev_dep_succeeds(): - with temporary_directory() as tmp_dir, cwd(os.path.join(fixtures, "with_bad_path_dev_dep")): + with temporary_directory() as tmp_dir, cwd( + os.path.join(fixtures, "with_bad_path_dev_dep") + ): api.build_sdist(tmp_dir) def test_build_sdist_with_bad_path_dep_fails(): - with pytest.raises(ValueError) as err, \ - temporary_directory() as tmp_dir, \ - cwd(os.path.join(fixtures, "with_bad_path_dep")): + with pytest.raises(ValueError) as err, temporary_directory() as tmp_dir, cwd( + os.path.join(fixtures, "with_bad_path_dep") + ): api.build_sdist(tmp_dir) assert "../only/in/dev" in str(err.value) @@ -199,13 +203,15 @@ def test_prepare_metadata_for_build_wheel(): def test_prepare_metadata_for_build_wheel_with_bad_path_dev_dep_succeeds(): - with temporary_directory() as tmp_dir, cwd(os.path.join(fixtures, "with_bad_path_dev_dep")): + with temporary_directory() as tmp_dir, cwd( + os.path.join(fixtures, "with_bad_path_dev_dep") + ): api.prepare_metadata_for_build_wheel(tmp_dir) def test_prepare_metadata_for_build_wheel_with_bad_path_dep_succeeds(): - with pytest.raises(ValueError) as err, \ - temporary_directory() as tmp_dir, \ - cwd(os.path.join(fixtures, "with_bad_path_dep")): + with pytest.raises(ValueError) as err, temporary_directory() as tmp_dir, cwd( + os.path.join(fixtures, "with_bad_path_dep") + ): api.prepare_metadata_for_build_wheel(tmp_dir) assert "../only/in/dev" in str(err.value) diff --git a/tests/test_factory.py b/tests/test_factory.py index ce5308f83..0703d9f12 100644 --- a/tests/test_factory.py +++ b/tests/test_factory.py @@ -23,8 +23,8 @@ def test_create_poetry(): assert package.authors == ["Sébastien Eustace "] assert package.license.id == "MIT" assert ( - package.readme.relative_to(fixtures_dir).as_posix() - == "sample_project/README.rst" + package.readme.relative_to(fixtures_dir).as_posix() + == "sample_project/README.rst" ) assert package.homepage == "https://python-poetry.org" assert package.repository_url == "https://github.com/python-poetry/poetry" @@ -95,8 +95,8 @@ def test_create_poetry(): assert functools32.name == "functools32" assert functools32.pretty_constraint == "^3.2.3" assert ( - str(functools32.marker) - == 'python_version ~= "2.7" and sys_platform == "win32" or python_version in "3.4 3.5"' + str(functools32.marker) + == 'python_version ~= "2.7" and sys_platform == "win32" or python_version in "3.4 3.5"' ) assert "db" in package.extras