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

pytest: Add very basic config to run pytest #2183

Merged
merged 3 commits into from
Feb 9, 2022

Conversation

wenzeslaus
Copy link
Member

This adds pytest configuration and one pytest-ready test file so that pytest can run on the source code without errors.

Notably, this does not use or run any of the existing tests and searches for tests in directories called tests (instead of testsuite).

There is no handling of GRASS session or any test data. Each test needs to set up the session by itself.

However, given that the test assume import grass will work, the command 'pytest .' will work without errors only when Python path (PYTHONPATH) is set beforehand. (The CI is using grass --config to get it.)

The idea is to allow for writing tests in a different style with pytest and later add functionality for easier setup or data comparison.

This adds pytest configuration and one pytest-ready test file so that pytest can run on the source code without errors.

Notably, this does not use or run any of the existing tests and searches for tests in directories called tests (instead of testsuite).

There is no handling of GRASS session or any test data. Each test needs to set up the session by itself.

However, given that the test assume import grass will work, the command 'pytest .' will work without errors only when Python path (PYTHONPATH) is set beforehand. (The CI is using grass --config to get it.)

The idea is to allow for writing tests in a different style with pytest and later add functionality for easier setup or data comparison.
@wenzeslaus wenzeslaus added CI Continuous integration enhancement New feature or request labels Feb 8, 2022
@wenzeslaus wenzeslaus marked this pull request as ready for review February 8, 2022 17:41
@wenzeslaus wenzeslaus merged commit 924db55 into OSGeo:main Feb 9, 2022
@wenzeslaus wenzeslaus deleted the basic-pytest branch February 9, 2022 02:20
@wenzeslaus wenzeslaus added this to the 8.2.0 milestone Feb 16, 2022
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
This adds pytest configuration and one pytest-ready test file so that pytest can run on the source code without errors.

Notably, this does not use or run any of the existing tests and searches for tests in directories called tests (instead of testsuite).

There is no handling of GRASS session or any test data. Each test needs to set up the session by itself.

However, given that the test assume import grass will work, the command 'pytest .' will work without errors only when Python path (PYTHONPATH) is set beforehand. (The CI is using 'grass --config ...' to get it.)

The idea is to allow for writing of tests in a different style with pytest and later add functionality for easier setup or data comparison.
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
This adds pytest configuration and one pytest-ready test file so that pytest can run on the source code without errors.

Notably, this does not use or run any of the existing tests and searches for tests in directories called tests (instead of testsuite).

There is no handling of GRASS session or any test data. Each test needs to set up the session by itself.

However, given that the test assume import grass will work, the command 'pytest .' will work without errors only when Python path (PYTHONPATH) is set beforehand. (The CI is using 'grass --config ...' to get it.)

The idea is to allow for writing of tests in a different style with pytest and later add functionality for easier setup or data comparison.
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
This adds pytest configuration and one pytest-ready test file so that pytest can run on the source code without errors.

Notably, this does not use or run any of the existing tests and searches for tests in directories called tests (instead of testsuite).

There is no handling of GRASS session or any test data. Each test needs to set up the session by itself.

However, given that the test assume import grass will work, the command 'pytest .' will work without errors only when Python path (PYTHONPATH) is set beforehand. (The CI is using 'grass --config ...' to get it.)

The idea is to allow for writing of tests in a different style with pytest and later add functionality for easier setup or data comparison.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous integration enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant