diff options
author | Frederick Muriuki Muriithi | 2022-09-20 22:45:04 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-09-20 22:45:04 +0300 |
commit | 768c05bb521716873e0ee1050bab360f09345a5b (patch) | |
tree | 2de48ac76b4e1a25e04246f51ff14e29f4db2d69 | |
parent | 4fafdfd8487ddf61105b2a5ca92534c8014c1db4 (diff) | |
download | genenetwork2-768c05bb521716873e0ee1050bab360f09345a5b.tar.gz |
Revert "Use member variable `self.conn` to avoid test failure"
This reverts commit 4fafdfd8487ddf61105b2a5ca92534c8014c1db4.
While using `self.conn.cursor()` works in the tests, it will not work
in the application since the point of initialisation could be very
different from the point where the 'property' is called.
-rw-r--r-- | wqflask/base/species.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/wqflask/base/species.py b/wqflask/base/species.py index 403e0bbb..0ee04630 100644 --- a/wqflask/base/species.py +++ b/wqflask/base/species.py @@ -47,7 +47,7 @@ class Chromosomes: def chromosomes(self) -> OrderedDict: """Lazily fetch the chromosomes""" chromosomes = OrderedDict() - with self.conn.cursor() as cursor: + with database_connection() as conn, conn.cursor() as cursor: if self.species is not None: cursor.execute( "SELECT Chr_Length.Name, Chr_Length.OrderId, Length " |