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

Tests: Fixed test execution #4043

Merged
merged 2 commits into from
Jan 15, 2024
Merged

Tests: Fixed test execution #4043

merged 2 commits into from
Jan 15, 2024

Conversation

t20100
Copy link
Member

@t20100 t20100 commented Jan 12, 2024

This PR runs pytest in a subprocess for both silx.test.run_tests and run_tests.py.
Previous way of running tests had issue with pytest 8.0.0rc1 apparently because of the module path. Since pytest is playing with the imports, it is anyway best IMO to run it separately.

Failing CI:

@t20100 t20100 added this to the 2.0.0 milestone Jan 12, 2024
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_NAME = get_project_name(PROJECT_DIR)
logger.info("Project name: %s", PROJECT_NAME)

project_module = import_project_module(PROJECT_NAME, PROJECT_DIR)
PROJECT_VERSION = getattr(project_module, "version", "")
PROJECT_PATH = project_module.__path__[0]
PROJECT_PATH = str(Path(project_module.__path__[0]).resolve())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use resolve to use canonical path

@payno payno merged commit 2e8eaaf into silx-kit:main Jan 15, 2024
4 of 8 checks passed
@t20100 t20100 deleted the fix-pytest branch January 15, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants