Skip to content

teardown_class not being run #5201

Closed
Closed
@jaraco

Description

@jaraco

I've started to notice after running the tests for pmxbot that some of the files that are meant to be deleted ('tests/functional/testconf.yaml', 'sqllite.sqllite') are lingering on the file system.

The teardown_class methods are supposed to be cleaning up those things, and they used to, but now they're not, likely due to an update of pytest.

Here's the pip list:

pmxbot master $ .tox/python/bin/pip list                                                                                                                                       
Package                       Version                Location                           
----------------------------- ---------------------- -----------------------------------
atomicwrites                  1.3.0                  
attrs                         19.1.0                 
backports.functools-lru-cache 1.5                    
backports.method-request      1.2                    
backports.unittest-mock       1.4                    
beautifulsoup4                4.7.1                  
certifi                       2019.3.9               
chardet                       3.0.4                  
cheroot                       6.5.5                  
CherryPy                      18.1.1                 
docutils                      0.14                   
entrypoints                   0.3                    
feedparser                    5.2.1                  
flake8                        3.7.7                  
future-fstrings               1.1.0                  
idna                          2.8                    
importlib-metadata            0.9                    
importlib-resources           1.0.2                  
inflect                       2.1.0                  
irc                           15.1.1                 
jaraco.apt                    2.0                    
jaraco.classes                2.0                    
jaraco.collections            2.0                    
jaraco.compat                 3.0                    
jaraco.context                2.0                    
jaraco.functools              2.0                    
jaraco.itertools              4.4.2                  
jaraco.logging                2.0                    
jaraco.mongodb                10.3.0                 
jaraco.services               3.0                    
jaraco.stream                 2.0                    
jaraco.text                   3.0                    
jaraco.ui                     2.0.1                  
Jinja2                        2.10.1                 
MarkupSafe                    1.1.1                  
mccabe                        0.6.1                  
more-itertools                7.0.0                  
path.py                       12.0.1                 
pip                           19.0.3                 
pluggy                        0.9.0                  
pmxbot                        1122.9.1.dev5+g79e8264 /Users/jaraco/code/yg/public/pmxbot
portend                       2.4                    
py                            1.8.0                  
pycodestyle                   2.5.0                  
pyflakes                      2.1.1                  
pymongo                       3.8.0                  
pytest                        4.4.1                  
pytest-checkdocs              1.2.0                  
pytest-flake8                 1.0.4                  
python-dateutil               2.8.0                  
pytimeparse                   1.1.8                  
pytz                          2019.1                 
PyYAML                        5.1                    
requests                      2.21.0                 
setuptools                    41.0.1                 
setuptools-scm                3.2.0                  
six                           1.12.0                 
soupsieve                     1.9.1                  
tempora                       1.14.1                 
urllib3                       1.24.3                 
wheel                         0.33.1                 
wordnik-py3                   2.1.2                  
yg.lockfile                   2.3                    
zc.lockfile                   1.4                    
zipp                          0.4.0                  

I've added a "raise ValueError()" into the teardown_class methods (such as this one), but no error occurs during the test run, so I suspect that pytest is somehow no longer honoring teardown_class.

Perhaps something was changed that causes teardown_class to only be honored for the test classes themselves (and not their base classes). I hope to do more investigation later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs informationreporter needs to provide more information; can be closed after 2 or more weeks of inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions