Pylons / pyramid-cookiecutter-starter

A Cookiecutter (project template) for creating a Pyramid starter project with choices for template language (Jinja2, Chameleon, or Mako), persistent backend (none, SQLAlchemy with SQLite, or ZODB), and mapping of URLs to routes (URL dispatch or traversal)
95 stars 53 forks source link

Using `setUp`/`tearDown` methods from `pyramid.testing` in `conftest.py`? #114

Closed atronah closed 2 years ago

atronah commented 2 years ago

Please, help me to understand.

Wouldn't it be more correct to use methods setUp/tearDown (from pyramid.testing) during the initializing of the test app fixtures?

Considering the following part of docstring for method setUp:

If you use the get_current_* functions (or call Pyramid code that uses these functions) without calling setUp, pyramid.threadlocal.get_current_registry will return a global application registry, which may cause unit tests to not be isolated with respect to registrations they perform.

atronah commented 2 years ago

Only after posting that issue I realized, that generated conftest.py contains a dummy_config fixture which uses testConfig for the purposes described above.