Skip to content

Commit

Permalink
Merge pull request #6062 from davidlowryduda/testing
Browse files Browse the repository at this point in the history
Remove unittest2, return to unittest
  • Loading branch information
AndrewVSutherland committed May 26, 2024
2 parents 45fb639 + c5c9fd6 commit 4c35ab8
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 185 deletions.
165 changes: 0 additions & 165 deletions install-deps.sh

This file was deleted.

1 change: 0 additions & 1 deletion lmfdb/artin_representations/test_artin_representation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from lmfdb.tests import LmfdbTest
#import unittest2

class ArtinRepTest(LmfdbTest):

Expand Down
4 changes: 2 additions & 2 deletions lmfdb/classical_modular_forms/test_cmf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

from lmfdb.tests import LmfdbTest
import unittest2
import unittest

from . import cmf_logger
cmf_logger.setLevel(100)
Expand Down Expand Up @@ -76,7 +76,7 @@ def test_level_bread(self):
assert '10.10.b.a' in page.get_data(as_text=True)
assert '2580' in page.get_data(as_text=True)

@unittest2.skip("Long tests for many newform spaces, should be run & pass before any release")
@unittest.skip("Long tests for many newform spaces, should be run & pass before any release")
def test_many(self):
from sage.all import ZZ
for Nk2 in range(1, 2001):
Expand Down
5 changes: 3 additions & 2 deletions lmfdb/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest2
import unittest

from urllib.request import Request, urlopen
from urllib.error import URLError
import ssl
Expand All @@ -16,7 +17,7 @@
assert NumberField


class LmfdbTest(unittest2.TestCase):
class LmfdbTest(unittest.TestCase):
def setUp(self):
app.config["TESTING"] = True
self.app = app
Expand Down
7 changes: 4 additions & 3 deletions lmfdb/tests/test_root.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest2
import unittest

from flask import url_for
from lmfdb.tests import LmfdbTest

Expand Down Expand Up @@ -37,7 +38,7 @@ def test_css(self):
assert '*[knowl]' in css
assert 'border-bottom: 1px dotted' in css

@unittest2.skip("Tests all url_maps, but fails at the moment because of other errors")
@unittest.skip("Tests all url_maps, but fails at the moment because of other errors")
def test_url_map(self):
"""
Expand All @@ -48,7 +49,7 @@ def test_url_map(self):
res = tc.get(rule.rule)
assert "Database" in res.get_data(as_text=True), "rule %s failed " % rule

@unittest2.skip("Tests for latex errors, but fails at the moment because of other errors")
@unittest.skip("Tests for latex errors, but fails at the moment because of other errors")
def test_some_latex_error(self):
"""
Tests for latex errors, but fails at the moment because of other errors
Expand Down
4 changes: 2 additions & 2 deletions lmfdb/tests/test_spelling.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@


from lmfdb.tests import LmfdbTest
import unittest2
import unittest


class SpellingTest(LmfdbTest):
# this tests the spelling on the website

@unittest2.skip("Tests for 'zeroes' should be 'zeros', but fails at the moment because of other errors")
@unittest.skip("Tests for 'zeroes' should be 'zeros', but fails at the moment because of other errors")
def test_zeroes_spelling(self):
"""
'zeroes' should be 'zeros'
Expand Down
7 changes: 4 additions & 3 deletions lmfdb/tests/test_tensor_products.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest2
import unittest

from lmfdb.tests import LmfdbTest


Expand All @@ -11,12 +12,12 @@ class TensorProductTest(LmfdbTest):
conductor is displayed somewhere on the page.
"""

@unittest2.skip("Tests tensor product of elliptic curve and Dirchlet L-functions -- skipping all tensor product tests ")
@unittest.skip("Tests tensor product of elliptic curve and Dirchlet L-functions -- skipping all tensor product tests ")
def test_ellcurve_dirichletchar(self):
L = self.tc.get("/TensorProducts/show/?obj1=Character%2FDirichlet%2F13%2F2&obj2=EllipticCurve%2FQ%2F11.a2")
assert '1859' in L.get_data(as_text=True)

@unittest2.skip("Tests tensor product of artin rep and modular form L-functions -- skipping all tensor product tests ")
@unittest.skip("Tests tensor product of artin rep and modular form L-functions -- skipping all tensor product tests ")
def test_modform_artinrep(self):
L1 = self.tc.get("ModularForm/GL2/Q/holomorphic/1/12/1/a/")
assert "6048q^{6}" in L1.get_data(as_text=True)
Expand Down
4 changes: 2 additions & 2 deletions lmfdb/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.

import unittest2
import unittest

from sage.all import var

Expand All @@ -31,7 +31,7 @@
)


class UtilsTest(unittest2.TestCase):
class UtilsTest(unittest.TestCase):
"""
An example of unit tests that are not based on the website itself.
"""
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ pytest-cov
pytest-xdist
pyyaml
timeout_decorator
git+https://github.com/edgarcosta/unittest2
7 changes: 3 additions & 4 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@

# Note: to run the tests, sage must be in your path. If necessary do
# export PATH=$PATH:/path/to/sage
# To run it, first install or upgrade "pytest", "unittest2" "pytest-cov" and
# "pyflakes". e.g. $ pip install --user -U pytest pytest-cov unittest2 pyflakes
# or $ sage -pip install --user -U pytest pytest-cov unittest2 pyflakes
# To run it, first install or upgrade "pytest", "pytest-cov" and
# "pyflakes". e.g. $ pip install --user -U pytest pytest-cov pyflakes
# or $ sage -pip install --user -U pytest pytest-cov pyflakes
# or inside the Sage environment: $ easy_install -U pytest
# $ easy_install -U pytest-cov
# $ easy_install -U unittest2
# $ easy_install -U pyflakes
# Second, call it in three ways, either
# $ ./test.sh to test all
Expand Down

0 comments on commit 4c35ab8

Please sign in to comment.