We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import pytest from simple_settings import settings def pytest_addoption(parser): parser.addoption('--settings', action='store', default='config.env_qa')
import pytest from simple_settings import settings @pytest.mark.httptest_p0 class TestBotJobCase(TestBase): @pytest.mark.parametrize("args", data_item, ids=id_item) def test_bot_get_job_case(self, args): res = HttpUtils.http_get(self.headers, settings.JOB_BASE_URL+self.url_path, args['params'])
import pytest if __name__ == '__main__': pytest.main(['--settings=config.env_qa', "-m", "httptest_p0", "--html=./testoutput/report.html"])
The text was updated successfully, but these errors were encountered:
This has no chance of working, as it's your script is swallowing all command line arguments.
Run python run.py
python run.py
> raise RuntimeError("Settings are not configured") E RuntimeError: Settings are not configured
Now try: pytest --settings=config.env_qa tests/
pytest --settings=config.env_qa tests/
tests/test_some.py . [100%] ============================================================= 1 passed in 0.01s ==============================================================
If you want to wrap your script within run.py, use env variable:
import os import pytest if __name__ == "__main__": os.environ["SIMPLE_SETTINGS"] = "app.env_qa" pytest.main(["tests/"])
Sorry, something went wrong.
No branches or pull requests
conftest.py
test.py
run.py
Errors
The text was updated successfully, but these errors were encountered: