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

How do I run the tests? #6

Open
digulla opened this issue Mar 12, 2017 · 5 comments
Open

How do I run the tests? #6

digulla opened this issue Mar 12, 2017 · 5 comments

Comments

@digulla
Copy link

digulla commented Mar 12, 2017

I'd expect to run the tests with python3 setup.py test but that runs 0 tests:

> python3 setup.py test
running test
@rigglemania
Copy link
Owner

rigglemania commented Mar 15, 2017

I just verified it works fine for me. I am running on Linux, so I'm not sure what environment you are on

python setup.py test
Ran 42 tests in 6.821s

@digulla
Copy link
Author

digulla commented Mar 15, 2017

Same here (recent openSUSE Linux, RPM based). I did:

  • Create virtual env with venv3 for Python 3.4
  • git clone
  • python3 setup.py build
  • python3 setup.py test

The build works, the tests don't do anything. What version of python do you use?

@rigglemania
Copy link
Owner

I'm currently using Python 3.6 (I'm running arch linux), but the last time I updated this code, it was working with Python 3.4

@tdhopper
Copy link

I'm running python setup.py install && python setup.py test and getting very inconsistent results.

  • Python 2.7: Ran 0 tests in 0.000s
  • Python 3.4: Ran 0 tests in 0.000s
  • Python 3.5: Test failed: <unittest.runner.TextTestResult run=15 errors=2 failures=4>
  • Python 3.6: Test failed: <unittest.runner.TextTestResult run=15 errors=2 failures=4>
  • Python 3.7: Test failed: <unittest.runner.TextTestResult run=15 errors=2 failures=4>

This is on MacOS.

@tdhopper
Copy link

Test output in 3.5:

running test
running egg_info
writing dependency_links to pysqlcipher3.egg-info/dependency_links.txt
writing pysqlcipher3.egg-info/PKG-INFO
writing top-level names to pysqlcipher3.egg-info/top_level.txt
reading manifest file 'pysqlcipher3.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*~' found anywhere in distribution
writing manifest file 'pysqlcipher3.egg-info/SOURCES.txt'
running build_ext
Builds a C extension linking against libsqlcipher library
test_column_access (lib.test.python3.userfunctions.AuthorizerIllegalTypeTests) ... ok
test_table_access (lib.test.python3.userfunctions.AuthorizerIllegalTypeTests) ... ok
test_column_access (lib.test.python3.userfunctions.AuthorizerLargeIntegerTests) ... ok
test_table_access (lib.test.python3.userfunctions.AuthorizerLargeIntegerTests) ... ok
test_column_access (lib.test.python3.userfunctions.AuthorizerRaiseExceptionTests) ... ok
test_table_access (lib.test.python3.userfunctions.AuthorizerRaiseExceptionTests) ... ok
test_column_access (lib.test.python3.userfunctions.AuthorizerTests) ... ok
test_table_access (lib.test.python3.userfunctions.AuthorizerTests) ... ok
testAddPassword (lib.test.python3.sqlcipher.SqlCipherTests)
Test for adding a password to a plaintext database ... FAIL
testChangePassword (lib.test.python3.sqlcipher.SqlCipherTests)
Test for changing the database password ... FAIL
testCorrectPasswordEntered (lib.test.python3.sqlcipher.SqlCipherTests)
Test fetching data after entering the correct password ... ok
testNoPasswordEntered (lib.test.python3.sqlcipher.SqlCipherTests)
Test for database exception when entering no password ... FAIL
testWrongPasswordEntered (lib.test.python3.sqlcipher.SqlCipherTests)
Test for database exception when entering wrong password ... FAIL
python2 (unittest.loader._FailedTest) ... ERROR
lib.test.python2 (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: python2 (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: python2
Traceback (most recent call last):
  File "/Users/t/.pyenv/versions/3.5.4/lib/python3.5/unittest/loader.py", line 153, in loadTestsFromName
    module = __import__(module_name)
  File "/Users/t/repos/pysqlcipher3/lib/test/python2/__init__.py", line 25, in <module>
    from pysqlcipher3.test.python2 import (dbapi, dump, factory, hooks, regression,
ImportError: No module named 'pysqlcipher3.test.python2'


======================================================================
ERROR: lib.test.python2 (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: lib.test.python2
Traceback (most recent call last):
  File "/Users/t/.pyenv/versions/3.5.4/lib/python3.5/unittest/loader.py", line 462, in _find_test_path
    package = self._get_module_from_name(name)
  File "/Users/t/.pyenv/versions/3.5.4/lib/python3.5/unittest/loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "/Users/t/repos/pysqlcipher3/lib/test/python2/__init__.py", line 25, in <module>
    from pysqlcipher3.test.python2 import (dbapi, dump, factory, hooks, regression,
ImportError: No module named 'pysqlcipher3.test.python2'


======================================================================
FAIL: testAddPassword (lib.test.python3.sqlcipher.SqlCipherTests)
Test for adding a password to a plaintext database
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 97, in assertDatabaseError
    col_value = self.queryData(conn)
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 84, in queryData
    return conn.execute('select col from tbl').fetchone()[0]
pysqlcipher3.dbapi2.DatabaseError: file is not a database

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 51, in testAddPassword
    self.assertDatabaseError(None)
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 100, in assertDatabaseError
    self.assertEqual('file is encrypted or is not a database', str(ex))
AssertionError: 'file is encrypted or is not a database' != 'file is not a database'
- file is encrypted or is not a database
+ file is not a database


======================================================================
FAIL: testChangePassword (lib.test.python3.sqlcipher.SqlCipherTests)
Test for changing the database password
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 97, in assertDatabaseError
    col_value = self.queryData(conn)
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 84, in queryData
    return conn.execute('select col from tbl').fetchone()[0]
pysqlcipher3.dbapi2.DatabaseError: file is not a database

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 33, in testChangePassword
    self.assertDatabaseError(self.password)
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 100, in assertDatabaseError
    self.assertEqual('file is encrypted or is not a database', str(ex))
AssertionError: 'file is encrypted or is not a database' != 'file is not a database'
- file is encrypted or is not a database
+ file is not a database


======================================================================
FAIL: testNoPasswordEntered (lib.test.python3.sqlcipher.SqlCipherTests)
Test for database exception when entering no password
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 97, in assertDatabaseError
    col_value = self.queryData(conn)
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 84, in queryData
    return conn.execute('select col from tbl').fetchone()[0]
pysqlcipher3.dbapi2.DatabaseError: file is not a database

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 20, in testNoPasswordEntered
    self.assertDatabaseError(None)
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 100, in assertDatabaseError
    self.assertEqual('file is encrypted or is not a database', str(ex))
AssertionError: 'file is encrypted or is not a database' != 'file is not a database'
- file is encrypted or is not a database
+ file is not a database


======================================================================
FAIL: testWrongPasswordEntered (lib.test.python3.sqlcipher.SqlCipherTests)
Test for database exception when entering wrong password
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 97, in assertDatabaseError
    col_value = self.queryData(conn)
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 84, in queryData
    return conn.execute('select col from tbl').fetchone()[0]
pysqlcipher3.dbapi2.DatabaseError: file is not a database

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 25, in testWrongPasswordEntered
    self.assertDatabaseError("Wrong password")
  File "/Users/t/repos/pysqlcipher3/lib/test/python3/sqlcipher.py", line 100, in assertDatabaseError
    self.assertEqual('file is encrypted or is not a database', str(ex))
AssertionError: 'file is encrypted or is not a database' != 'file is not a database'
- file is encrypted or is not a database
+ file is not a database


----------------------------------------------------------------------
Ran 15 tests in 1.017s

FAILED (failures=4, errors=2)
Test failed: <unittest.runner.TextTestResult run=15 errors=2 failures=4>
error: Test failed: <unittest.runner.TextTestResult run=15 errors=2 failures=4>

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

No branches or pull requests

3 participants