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

Fix tests invocation on release CI worklow #489

Merged
merged 3 commits into from
Sep 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ jobs:
# This is needed for now because cffi has no cp310 wheels
CIBW_BEFORE_ALL_LINUX: "yum -y install libffi-devel"
CIBW_TEST_EXTRAS: "test"
CIBW_TEST_COMMAND: "python {project}/tests/__init__.py"
CIBW_TEST_COMMAND_WINDOWS: "python {project}\\tests\\__init__.py"
CIBW_TEST_COMMAND: "python -m unittest discover -v {project}/tests"
CIBW_TEST_COMMAND_WINDOWS: "python -m unittest discover -v {project}\\tests"
CIBW_TEST_SKIP: "*universal2:arm64"

- uses: actions/upload-artifact@v3
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ docs:


test:
PYTHONASYNCIODEBUG=1 $(PYTHON) -m unittest -v tests.suite
$(PYTHON) -m unittest -v tests.suite
PYTHONASYNCIODEBUG=1 $(PYTHON) -m unittest discover -v tests
$(PYTHON) -m unittest discover -v tests


testinstalled:
cd "$${HOME}" && $(PYTHON) $(ROOT)/tests/__init__.py
cd "$${HOME}" && $(PYTHON) -m unittest discover -v $(ROOT)/tests
17 changes: 0 additions & 17 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +0,0 @@
import os.path
import sys
import unittest
import unittest.runner


def suite():
test_loader = unittest.TestLoader()
test_suite = test_loader.discover(
os.path.dirname(__file__), pattern='test_*.py')
return test_suite


if __name__ == '__main__':
runner = unittest.runner.TextTestRunner()
result = runner.run(suite())
sys.exit(not result.wasSuccessful())
16 changes: 16 additions & 0 deletions tests/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os.path
import sys
import unittest
import unittest.runner


def suite():
test_loader = unittest.TestLoader()
test_suite = test_loader.discover(os.path.dirname(__file__))
return test_suite


if __name__ == '__main__':
runner = unittest.runner.TextTestRunner()
result = runner.run(suite())
sys.exit(not result.wasSuccessful())
2 changes: 1 addition & 1 deletion tests/test_libuv_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_libuv_get_loop_t_ptr(self):

pyximport.install()

from tests import cython_helper
import cython_helper

self.assertTrue(cython_helper.capsule_equals(cap1, cap2))
self.assertFalse(cython_helper.capsule_equals(cap1, cap3))
Expand Down