Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

conftest.py 544 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  1. import great_expectations as ge
  2. import pandas as pd
  3. import pytest
  4. def pytest_addoption(parser):
  5. """Add option to specify dataset location when executing tests from CLI.
  6. Ex: pytest --dataset-loc=$DATASET_LOC tests/data --verbose --disable-warnings
  7. """
  8. parser.addoption("--dataset-loc", action="store", default=None, help="Dataset location.")
  9. @pytest.fixture(scope="module")
  10. def df(request):
  11. dataset_loc = request.config.getoption("--dataset-loc")
  12. df = ge.dataset.PandasDataset(pd.read_csv(dataset_loc))
  13. return df
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...