Skip to content
Advertisement

Tag: pytest

pytest is not running conftest.py to pick up custom command args

In a project im working on we have a step where we export a csv before exporting we run a regression test step against the report using pytest. pytest is invoked using the following command –sample and –expectations are custom args defined in the conftest.py using the following when calling this code locally it works pytest finds the conf but

Mocking sqlobject function call for test db

I am trying to mock sqlbuilder.func for test cases with pytest I successfully mocked sqlbuilder.func.TO_BASE64 with correct output but when I tried mocking sqlbuilder.func.FROM_UNIXTIME I didn’t get any error but the resulted output is incorrect with the generated query. Below is the minimal working example of the problem. models.py conftest.py test_ex1.py Current SQL: Expected SQL: Edit Example Answer By default,

Publish Unit test in Python

I need to publish the result, but could not and have looked through this site and made research but still having issue to publish test result. Do I need to edit certain file similar to the cypress.json to be able to resolve the issue of Publishing. Both Unit test and the coveratge are not publishing any result and files are

django pytest how to test a view with argument(id)

i have a question regarding using pytest. These are my very 1st tests. I have 2 views which i want to test (simplest possible way). Views: Here are my tests: Urls: 1st test (menu view) is working properly 2nd test (cuisine details view) shows error I know i should probably put somethere ID argument but tried few options and havent

How to impose order on fixtures in pytest?

I am trying to use pytest-dependency to make fixtures happen in order, regardless of how they are named, and regardless of the order in which they appear in a test’s argument list. The reason I need this, is to create fixtures that require initializations, that depend on other fixtures that require initializations, and they must happen in order. I have

ImportError in test files

I’ve seen a lot of questions that are similar to this but none of the solutions have worked for me. I’m getting an import error when trying to run pytest on a test package I’m developing to teach myself how to create python packages. Currently I have a python package that looks like and my test_module_a.py contains Running the command

Advertisement