vext01 / passout

Simple password manager built on GnuPG.
4 stars 1 forks source link

Tests fail when running under Python 2 virtualenv #17

Open vext01 opened 8 years ago

vext01 commented 8 years ago

Outside of virtual env under Python 2:

$ py.test
============================= test session starts ==============================
platform openbsd5 -- Python 2.7.10 -- py-1.4.23 -- pytest-2.6.1
collected 20 items 

tests/test_cli.py ........
tests/test_lib.py ............

========================== 20 passed in 26.43 seconds ==========================

And inside:

$ /tmp/py/bin/py.test
============================= test session starts ==============================
platform openbsd5 -- Python 2.7.10, pytest-2.8.2, py-1.4.30, pluggy-0.3.1
rootdir: /home/edd/source/passout, inifile: 
collected 20 items 

tests/test_cli.py .....F..
tests/test_lib.py ............

=================================== FAILURES ===================================
______________________________ TestCLI.test_clip _______________________________

self = <test_cli.TestCLI object at 0x122891fcd210>
rand_pwname = '6037cd947b3511e5ab0b434358fd149a'
rand_pw = '6037d2807b3511e5ab0b434358fd149a'

    @pytest.mark.skipif(os.environ["DISPLAY"] is None, reason="No X11")
    def test_clip(self, rand_pwname, rand_pw):
        # XXX skip if xclip not found

        child1 = self.run_passout("add", rand_pwname)
        child1.expect_exact("Password: ")
        child1.sendline(rand_pw)
        child1.expect_exact(pexpect.EOF)

        child2 = self.run_passout("clip", rand_pwname)
        child2.expect(pexpect.EOF)

        # Testing all clipboards
        import passout
        for clip in passout.XCLIP_CLIPBOARDS:
            data = support.get_clipboard_text(clip)
>           assert data == rand_pw
E           assert '' == '6037d2807b3511e5ab0b434358fd149a'
E             + 6037d2807b3511e5ab0b434358fd149a

tests/test_cli.py:83: AssertionError
===================== 1 failed, 19 passed in 26.10 seconds =====================

The failure looks similar to the one found in #16.