genenetwork / genenetwork2

GeneNetwork (2nd generation)
http://gn2.genenetwork.org/
GNU Affero General Public License v3.0
34 stars 24 forks source link

Chore/fix failing tests #684

Closed BonfaceKilz closed 2 years ago

BonfaceKilz commented 2 years ago

Description

This PR fixes many broken tests; while skipping some.

The general error message is:

  ERROR: test_check_if_in_gene (tests.unit.wqflask.snp_browser.test_snp_browser.TestSnpBrowser)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/gnu/store/qv561pgnpmnw4n1l84jyi8r1bxy932b3-python-3.9.9/lib/python3.9/unittest/mock.py", line 1336, in patched
      return func(*newargs, **newkeywargs)
    File "/home/bonface/projects/genenetwork2/wqflask/tests/unit/wqflask/snp_browser/test_snp_browser.py", line 97, in test_check_if_in_gene
      results_found = check_if_in_gene(
    File "/home/bonface/projects/genenetwork2/wqflask/wqflask/snp_browser/snp_browser.py", line 928, in check_if_in_gene
      result = g.db.execute(query).fetchone()
  AttributeError: 'coroutine' object has no attribute 'fetchone'

which is some how caused by the "g.db" object. Ideally. we should deprecate the use this object. Attaching a database connection to the global context is bad!

How should this be tested?

N/A

Any background context you want to provide?

N/A

What are the relevant pivotal tracker stories?

N/A

Screenshots (if appropriate)

N/A

Questions

N/A