paulsuh / pytest-scenario-files Goto Github PK
View Code? Open in Web Editor NEWPytest plug-in to load parameterized data from files
Home Page: https://pytest-scenario-files.mspex.net/
License: MIT License
Pytest plug-in to load parameterized data from files
Home Page: https://pytest-scenario-files.mspex.net/
License: MIT License
Will need this to make more complex examples.
A very common use case for stored data is to set up mock calls to outside services using requests or https, which are then mocked out for unit tests by using responses or pytest-httpx.
Enhancement request: add a way to set up responses or pytest-httpx easily without writing a separate pytest fixture.
May depend on issue #1
If a fixture is marked as autouse
, every test will try to load data for that fixture. If a particular test does not have a data file for that fixture it will result in an error. As a best practice, do not apply autouse
on a fixture that will load from a data file.
Python 3.9-3.12, Pytest 6.2.x-8.x.
There are a couple of different ways to do this. See:
Integrate this with merging a pull request to main
Using requests, moto, and responses
Add a utility function that can be called to create a pytest expected exception from expected_value
.
Right now it is only possible to import all of a fixture's data from another source. There is no way to import and merge data from multiple sources. It would be nice to be able to pull lists from multiple sources and have them be merged into a single list. For example:
scenario_1:
fixture_a:
- fixture_a_local_value
- __file_AAA.yaml:scenario_1:fixture_a_value_1
- __file_BBB.yaml:scenario_1:fixture_a_values_list_2
This would be merged into a single list for fixture_a
. If the imported data is a non-list value it will be added to the list as in fixture_a_value_1
. If the imported data is a list value then the imported list will be appended to the existing list as in fixture_a_values_list_2
. Local values are also permitted for the list.
It's ready.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.