Skip to content
New issue

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

Different unittest behavior #9

Open
robinsonkwame opened this issue Nov 4, 2017 · 0 comments
Open

Different unittest behavior #9

robinsonkwame opened this issue Nov 4, 2017 · 0 comments

Comments

@robinsonkwame
Copy link
Member

robinsonkwame commented Nov 4, 2017

For skilloracle, running python -m unittest results in output such as,

This is nc from the netcat-openbsd package. An alternative nc is available
in the netcat-traditional package.
usage: nc [-46bCDdhjklnrStUuvZz] [-I length] [-i interval] [-O length]
      [-P proxy_username] [-p source_port] [-q seconds] [-s source]
      [-T toskeyword] [-V rtable] [-w timeout] [-X proxy_protocol]
      [-x proxy_address[:port]] [destination] [port]
This is nc from the netcat-openbsd package. An alternative nc is available
in the netcat-traditional package.
usage: nc [-46bCDdhjklnrStUuvZz] [-I length] [-i interval] [-O length]
      [-P proxy_username] [-p source_port] [-q seconds] [-s source]
      [-T toskeyword] [-V rtable] [-w timeout] [-X proxy_protocol]
      [-x proxy_address[:port]] [destination] [port]
/hdd/work/WDI/skills-labeller/skilloracle/skilloracle/skilloracle/skilloracle.py:65: ResourceWarning: unclosed file <_io.BufferedReader name=4>
 self.sendrecv(host, port, "1")
/usr/lib/python3.5/unittest/case.py:600: ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 54564), raddr=('127.0.0.1', 7000)>
 testMethod()

Whereas running with py.test --pdb --fulltrace results in all tests passing with no additional output,

(py3) kwame@Puget-168695:/hdd/work/WDI/skills-labeller/skilloracle$ py.test --ipdb --fulltrace
======================================================== test session starts ========================================================
platform linux -- Python 3.5.2, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /hdd/work/WDI/skills-labeller/skilloracle, inifile:
plugins: ipdb-0.1
collected 2 items                                                                                                                    

test/test_skilloracle.py ..

===================================================== 2 passed in 2.86 seconds ======================================================

(with pip install pytest==3.2.3)

The resource warning behavior from unittest is seen here and here. We should standardize on what unittest to run and why and any workarounds; I favor py.test for now but I am pretty flexible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant