Skip to content

fix safe file handling in unit tests #109

@tomkralidis

Description

@tomkralidis

Description

Unit tests in a Python 3 environment yield ResourceWarning warnings like:

/home/travis/build/geopython/pywps/tests/test_inout.py:64: ResourceWarning: unclosed file <_io.FileIO name='/tmp/tmpwbpvbq0c' mode='rb'>

Environment

  • operating system: Ubuntu
  • Python version: 3.4
  • PyWPS version: master
  • source/distribution
    • git clone
    • Debian
    • PyPI
    • zip/tar.gz
    • other (please specify):
  • web server
    • Apache/mod_wsgi
    • CGI
    • other (please specify): unit test runner

Steps to Reproduce

# in a Python 3 virtualenv
python -m unittest tests

Additional Information

Initial discussion in #106.

Example can be found in current travis builds: https://travis-ci.org/geopython/pywps/jobs/111190874#L360

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions