From f8285cac4b95e6b43869e27093ef04552e665681 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 1 Jan 2015 23:31:22 -0500 Subject: Move fixture to a fixtures module and make that fixture available globally. --- conftest.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 conftest.py (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py new file mode 100644 index 00000000..a513bb9e --- /dev/null +++ b/conftest.py @@ -0,0 +1 @@ +pytest_plugins = 'setuptools.tests.fixtures' -- cgit v1.2.1 From cbd6a5bedbabb4d5dfa93e1b5fa297fe3df4528d Mon Sep 17 00:00:00 2001 From: Thiebaud Weksteen Date: Fri, 4 Nov 2016 09:43:26 +1100 Subject: Add test to verify the install of Pypi top packages --- conftest.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index a513bb9e..47a5d888 100644 --- a/conftest.py +++ b/conftest.py @@ -1 +1,8 @@ +import pytest + pytest_plugins = 'setuptools.tests.fixtures' + +def pytest_addoption(parser): + parser.addoption("--package_name", action="append", default=[], + help="list of package_name to pass to test functions") + -- cgit v1.2.1 From b890d3d27602b6c18985c735a0ba0933232deb82 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 1 Dec 2016 09:54:40 -0500 Subject: Clean up conftest.py --- conftest.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 47a5d888..ec8ddd8b 100644 --- a/conftest.py +++ b/conftest.py @@ -1,8 +1,7 @@ -import pytest - pytest_plugins = 'setuptools.tests.fixtures' def pytest_addoption(parser): - parser.addoption("--package_name", action="append", default=[], - help="list of package_name to pass to test functions") - + parser.addoption( + "--package_name", action="append", default=[], + help="list of package_name to pass to test functions", + ) -- cgit v1.2.1 From 413c234459de94766c8c57f10d11ef1599ae6ac0 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 1 Dec 2016 09:59:21 -0500 Subject: Monkeypatch the 'setuptools.__file__' attribute in test setup to be absolute. Workaround for #852. --- conftest.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index ec8ddd8b..0da92be9 100644 --- a/conftest.py +++ b/conftest.py @@ -1,7 +1,25 @@ +import os + + pytest_plugins = 'setuptools.tests.fixtures' + def pytest_addoption(parser): parser.addoption( "--package_name", action="append", default=[], help="list of package_name to pass to test functions", ) + + +def pytest_configure(): + _issue_852_workaround() + + +def _issue_852_workaround(): + """ + Patch 'setuptools.__file__' with an absolute path + for forward compatibility with Python 3. + Workaround for https://github.com/pypa/setuptools/issues/852 + """ + setuptools = __import__('setuptools') + setuptools.__file__ = os.path.abspath(setuptools.__file__) -- cgit v1.2.1 From 5c9406987aacf17d9c004aa1456797e0044306e5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Dec 2016 14:20:23 -0500 Subject: Use py.test to launch pytest, rather than python -m test, preventing the empty path from being added to sys.path per pytest-dev/pytest#2104. Fixes #852. Also use 'usedevelop' as the setuptools.tests.fixtures aren't available in a standard install. --- conftest.py | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 0da92be9..3cccfe1a 100644 --- a/conftest.py +++ b/conftest.py @@ -1,6 +1,3 @@ -import os - - pytest_plugins = 'setuptools.tests.fixtures' @@ -9,17 +6,3 @@ def pytest_addoption(parser): "--package_name", action="append", default=[], help="list of package_name to pass to test functions", ) - - -def pytest_configure(): - _issue_852_workaround() - - -def _issue_852_workaround(): - """ - Patch 'setuptools.__file__' with an absolute path - for forward compatibility with Python 3. - Workaround for https://github.com/pypa/setuptools/issues/852 - """ - setuptools = __import__('setuptools') - setuptools.__file__ = os.path.abspath(setuptools.__file__) -- cgit v1.2.1 From 445d38472d3dc2fd004b02d645e7eadcf26fbc30 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 6 Jun 2018 08:38:07 -0400 Subject: Move ignores into conftest.py --- conftest.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 3cccfe1a..13dc709a 100644 --- a/conftest.py +++ b/conftest.py @@ -6,3 +6,15 @@ def pytest_addoption(parser): "--package_name", action="append", default=[], help="list of package_name to pass to test functions", ) + + +collect_ignore = [ + 'release.py', + 'setuptools/lib2to3_ex.py', + 'tests/manual_test.py', + 'tests/test_pypi.py', + 'tests/shlib_test', + 'scripts/upload-old-releases-as-zip.py', + 'pavement.py', + 'setuptools/tests/mod_with_constant.py', +] -- cgit v1.2.1 From 992293d1aa03ad3e7258f51bdbb385ace4035737 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 6 Jun 2018 08:41:36 -0400 Subject: Remove crufty ignores --- conftest.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 13dc709a..abb79f1b 100644 --- a/conftest.py +++ b/conftest.py @@ -9,12 +9,9 @@ def pytest_addoption(parser): collect_ignore = [ - 'release.py', 'setuptools/lib2to3_ex.py', 'tests/manual_test.py', 'tests/test_pypi.py', - 'tests/shlib_test', - 'scripts/upload-old-releases-as-zip.py', 'pavement.py', 'setuptools/tests/mod_with_constant.py', ] -- cgit v1.2.1 From 0a39f8e47944ef416fdd276ec91a3be464fa8a2e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 6 Jun 2018 08:45:42 -0400 Subject: Only ignore collection on older Pythons --- conftest.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index abb79f1b..5bebe21a 100644 --- a/conftest.py +++ b/conftest.py @@ -1,3 +1,6 @@ +import sys + + pytest_plugins = 'setuptools.tests.fixtures' @@ -9,9 +12,12 @@ def pytest_addoption(parser): collect_ignore = [ - 'setuptools/lib2to3_ex.py', 'tests/manual_test.py', 'tests/test_pypi.py', 'pavement.py', 'setuptools/tests/mod_with_constant.py', ] + + +if sys.version_info < (3,): + collect_ignore.append('setuptools/lib2to3_ex.py') -- cgit v1.2.1 From 9832db367961e9215a1c55703dcbe47b339ca409 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 6 Jun 2018 08:53:57 -0400 Subject: Remove crufty, ignored test. --- conftest.py | 1 - 1 file changed, 1 deletion(-) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 5bebe21a..d966d68d 100644 --- a/conftest.py +++ b/conftest.py @@ -13,7 +13,6 @@ def pytest_addoption(parser): collect_ignore = [ 'tests/manual_test.py', - 'tests/test_pypi.py', 'pavement.py', 'setuptools/tests/mod_with_constant.py', ] -- cgit v1.2.1 From 3e3b9f7968fbe47b8e7038d1b1767676daecfaca Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 6 Jun 2018 08:57:21 -0400 Subject: Include pavement.py in tests (where applicable). --- conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index d966d68d..0d7b274c 100644 --- a/conftest.py +++ b/conftest.py @@ -13,10 +13,13 @@ def pytest_addoption(parser): collect_ignore = [ 'tests/manual_test.py', - 'pavement.py', 'setuptools/tests/mod_with_constant.py', ] if sys.version_info < (3,): collect_ignore.append('setuptools/lib2to3_ex.py') + + +if sys.version_info < (3, 6): + collect_ignore.append('pavement.py') -- cgit v1.2.1 From 85a9ca5e75abf00e0dde55dde4e2b0a11f93c04a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 27 Oct 2019 19:50:53 -0400 Subject: Extract 'imp' re-implementation to setuptools._imp and wrap it in py27compat for compatibility. --- conftest.py | 1 + 1 file changed, 1 insertion(+) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 0d7b274c..1746bfb5 100644 --- a/conftest.py +++ b/conftest.py @@ -19,6 +19,7 @@ collect_ignore = [ if sys.version_info < (3,): collect_ignore.append('setuptools/lib2to3_ex.py') + collect_ignore.append('setuptools/_imp.py') if sys.version_info < (3, 6): -- cgit v1.2.1 From 81aab2da23caf1a66298847d93b209ba16eb878e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 25 May 2020 16:35:24 -0400 Subject: Ignore distutils when running tests. --- conftest.py | 1 + 1 file changed, 1 insertion(+) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 1746bfb5..3f7e59b4 100644 --- a/conftest.py +++ b/conftest.py @@ -14,6 +14,7 @@ def pytest_addoption(parser): collect_ignore = [ 'tests/manual_test.py', 'setuptools/tests/mod_with_constant.py', + 'distutils', ] -- cgit v1.2.1 From bb9fb1fcfe37c1ef1e29e1e6d1fc4e483c743380 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 3 Jul 2020 03:53:46 -0400 Subject: Move distutils into a submodule of setuptools. --- conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 3f7e59b4..72edcf14 100644 --- a/conftest.py +++ b/conftest.py @@ -14,7 +14,7 @@ def pytest_addoption(parser): collect_ignore = [ 'tests/manual_test.py', 'setuptools/tests/mod_with_constant.py', - 'distutils', + 'setuptools/_distutils', ] -- cgit v1.2.1 From d0c71ab32deea2be265a8fcdec020089a8d1d987 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 3 Jul 2020 18:12:39 -0400 Subject: Omit distutils_patch from test collection. --- conftest.py | 1 + 1 file changed, 1 insertion(+) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 72edcf14..50cc6509 100644 --- a/conftest.py +++ b/conftest.py @@ -15,6 +15,7 @@ collect_ignore = [ 'tests/manual_test.py', 'setuptools/tests/mod_with_constant.py', 'setuptools/_distutils', + 'setuptools/distutils_patch.py', ] -- cgit v1.2.1 From 9f47efe757762351ec12b4303e747ac0774db991 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 3 Jul 2020 02:54:32 -0400 Subject: Programmatically disable coverage when running on PyPy. --- conftest.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 1746bfb5..0bc8d320 100644 --- a/conftest.py +++ b/conftest.py @@ -17,6 +17,24 @@ collect_ignore = [ ] +def pytest_configure(config): + disable_coverage_on_pypy(config) + + +def disable_coverage_on_pypy(config): + """ + Coverage makes tests on PyPy unbearably slow, so disable it. + """ + if '__pypy__' not in sys.builtin_module_names: + return + + # Recommended at pytest-dev/pytest-cov#418 + cov = config.pluginmanager.get_plugin('_cov') + cov.options.no_cov = True + if cov.cov_controller: + cov.cov_controller.pause() + + if sys.version_info < (3,): collect_ignore.append('setuptools/lib2to3_ex.py') collect_ignore.append('setuptools/_imp.py') -- cgit v1.2.1 From e371422476f51a83d27d70dc45bbfba1544aad55 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 19 Jul 2020 21:36:33 -0400 Subject: Consolidate distutils importing hacks into _distutils_importer package. Generate distutils-precedence.pth inline. --- conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 6013e187..868bf5be 100644 --- a/conftest.py +++ b/conftest.py @@ -15,7 +15,7 @@ collect_ignore = [ 'tests/manual_test.py', 'setuptools/tests/mod_with_constant.py', 'setuptools/_distutils', - 'setuptools/distutils_patch.py', + '_distutils_importer', ] -- cgit v1.2.1 From dcc71f773576c19a3658735879893515b056ece5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 26 Jul 2020 10:35:02 -0400 Subject: Rename _distutils_importer to _distutils_hack, as it supplies more than just an importer. --- conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 868bf5be..25537f56 100644 --- a/conftest.py +++ b/conftest.py @@ -15,7 +15,7 @@ collect_ignore = [ 'tests/manual_test.py', 'setuptools/tests/mod_with_constant.py', 'setuptools/_distutils', - '_distutils_importer', + '_distutils_hack', ] -- cgit v1.2.1 From f01d2719802d3345332b761fb1c62fa4afd212c9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 14 Sep 2020 19:05:13 -0400 Subject: Enable flake8 and cov plugins only when installed. Avoid installing in PyPy. --- conftest.py | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 25537f56..90090253 100644 --- a/conftest.py +++ b/conftest.py @@ -19,24 +19,6 @@ collect_ignore = [ ] -def pytest_configure(config): - disable_coverage_on_pypy(config) - - -def disable_coverage_on_pypy(config): - """ - Coverage makes tests on PyPy unbearably slow, so disable it. - """ - if '__pypy__' not in sys.builtin_module_names: - return - - # Recommended at pytest-dev/pytest-cov#418 - cov = config.pluginmanager.get_plugin('_cov') - cov.options.no_cov = True - if cov.cov_controller: - cov.cov_controller.pause() - - if sys.version_info < (3,): collect_ignore.append('setuptools/lib2to3_ex.py') collect_ignore.append('setuptools/_imp.py') -- cgit v1.2.1 From 2995140fe8fc3d0de9f9fa6fe0d574dc2d9a0ca3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 14 Sep 2020 19:30:08 -0400 Subject: Remove legacy warning suppressions and Python 2 ignored collections. --- conftest.py | 5 ----- 1 file changed, 5 deletions(-) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 25537f56..baffac1a 100644 --- a/conftest.py +++ b/conftest.py @@ -37,10 +37,5 @@ def disable_coverage_on_pypy(config): cov.cov_controller.pause() -if sys.version_info < (3,): - collect_ignore.append('setuptools/lib2to3_ex.py') - collect_ignore.append('setuptools/_imp.py') - - if sys.version_info < (3, 6): collect_ignore.append('pavement.py') -- cgit v1.2.1 From 896ef66ff3b167a13a5efb128013d5bd53633a79 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 24 Sep 2020 10:29:40 -0400 Subject: Move setuptools-specific excluded folders to collect_ignore to match with jaraco/skeleton. --- conftest.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 41ab30b9..f896561e 100644 --- a/conftest.py +++ b/conftest.py @@ -16,6 +16,11 @@ collect_ignore = [ 'setuptools/tests/mod_with_constant.py', 'setuptools/_distutils', '_distutils_hack', + 'setuptools/extern', + 'pkg_resources/extern', + 'pkg_resources/tests/data', + 'setuptools/_vendor', + 'pkg_resources/_vendor', ] -- cgit v1.2.1 From bb3072883f761f8537d1fc2b8a33b8cc82c1aa27 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sun, 20 Sep 2020 21:27:42 +0200 Subject: =?UTF-8?q?=F0=9F=9A=91=20Exclude=20sphinx=20conf=20from=20pytest?= =?UTF-8?q?=20auto-discovery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit But only under Python 3.5! --- conftest.py | 1 + 1 file changed, 1 insertion(+) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index f896561e..d5e851fe 100644 --- a/conftest.py +++ b/conftest.py @@ -25,4 +25,5 @@ collect_ignore = [ if sys.version_info < (3, 6): + collect_ignore.append('docs/conf.py') # uses f-strings collect_ignore.append('pavement.py') -- cgit v1.2.1