Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove %check for setup.py test #857

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions autospec/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,16 @@ def scan_for_tests(src_dir, config, requirements, content):
"{} test || :\nmodule unload openmpi".format(make_command)

perl_check = "{} TEST_VERBOSE=1 test".format(make_command)
setup_check = """PYTHONPATH=%{buildroot}$(python -c "import sys; print(sys.path[-1])") python setup.py test"""
meson_check = "meson test -C builddir --print-errorlogs"
if config.config_opts.get('allow_test_failures'):
make_check += " || :"
cmake_check += " || :"
perl_check += " || :"
setup_check += " || :"
meson_check += " || :"

testsuites = {
"makecheck": make_check,
"perlcheck": perl_check,
"setup.py": setup_check,
"cmake": "cd clr-build; " + cmake_check,
"meson": meson_check,
}
Expand Down Expand Up @@ -145,13 +142,6 @@ def scan_for_tests(src_dir, config, requirements, content):
elif config.default_pattern in ["cpan"] and "Makefile.PL" in files:
tests_config = testsuites["perlcheck"]

elif config.default_pattern == "distutils3" and "setup.py" in files:
with util.open_auto(os.path.join(src_dir, "setup.py"), 'r') as setup_fp:
setup_contents = setup_fp.read()

if "test_suite" in setup_contents or "pbr=True" in setup_contents:
tests_config = testsuites["setup.py"]

elif config.default_pattern == "R":
tests_config = "export _R_CHECK_FORCE_SUGGESTS_=false\n" \
"R CMD check --no-manual --no-examples --no-codoc . " \
Expand Down
20 changes: 0 additions & 20 deletions tests/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,26 +152,6 @@ def test_scan_for_tests_perlcheck_in(self):
check.os.listdir = listdir_backup
self.assertEqual(check.tests_config, 'make TEST_VERBOSE=1 test')

def test_scan_for_tests_setup(self):
"""
Test scan_for_tests with setup.py suite
"""
reqs = buildreq.Requirements("")
conf = config.Config("")
tcontent = tarball.Content("", "", "", [], conf, "")
listdir_backup = os.listdir
check.os.listdir = mock_generator(['setup.py'])
content = 'test_suite'
m_open = mock_open(read_data=content)
with patch(self.open_name, m_open, create=True):
conf.default_pattern = "distutils3"
check.scan_for_tests('pkgdir', conf, reqs, tcontent)

check.os.listdir = listdir_backup
self.assertEqual(check.tests_config,
'PYTHONPATH=%{buildroot}$(python -c "import sys; print(sys.path[-1])") '
'python setup.py test')

def test_scan_for_tests_cmake(self):
"""
Test scan_for_tests with cmake suite
Expand Down
Loading