Skip to content

Commit

Permalink
changed preprocess_test to use pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
weiju committed Mar 8, 2024
1 parent e2b98e9 commit 2f7ada9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ graphviz>=0.20.1
gql>=3.4.0
chembl_webresource_client>=0.10.8
tqdm>=4.64.0
xmlrunner>=1.7.7
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'graphviz>=0.20.1',
'gql>=3.4.0',
'chembl_webresource_client>=0.10.8',
'tqdm>=4.64.0', "xmlrunner>=1.7.7"]
'tqdm>=4.64.0']
setuptools.setup(
name="isb_miner3",
version="1.1.9",
Expand Down
25 changes: 7 additions & 18 deletions test/preprocess_test.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#!/usr/bin/env python3
import sys
import unittest
import xmlrunner
import pytest

import pandas as pd
#import pandas as pd
from miner import miner
import logging

"""
class PreprocessTest(unittest.TestCase):
"""
def test_remove_null_rows_min_0_remove_ok(self):
df = pd.DataFrame([[0, 1, 2], [1, 2, 3], [0, 0, 0], [4, 5, 6]])
df2 = miner.remove_null_rows(df)
Expand Down Expand Up @@ -51,24 +50,14 @@ def test_correct_batch_effects_no_tpm(self):
for i in range(3):
for j in range(3):
self.assertAlmostEquals(df2.values[i, j], -0.8164965809277261)
"""
"""
def test_preprocess_main_simple(self):
exp, conv_table = miner.preprocess('testdata/exp_data-001.csv', 'testdata/conv_table-001.tsv')
self.assertEquals((10, 3), exp.shape)
for i in range(3):
for j in range(3):
self.assertAlmostEquals(exp.values[i, j], -0.8164965809277261)
"""
"""

if __name__ == '__main__':
SUITE = []
LOG_FORMAT = '%(asctime)s %(message)s'
logging.basicConfig(format=LOG_FORMAT, level=logging.DEBUG,
datefmt='%Y-%m-%d %H:%M:%S \t')
SUITE.append(unittest.TestLoader().loadTestsFromTestCase(PreprocessTest))
if len(sys.argv) > 1 and sys.argv[1] == 'xml':
xmlrunner.XMLTestRunner(output='test-reports').run(unittest.TestSuite(SUITE))
else:
unittest.TextTestRunner(verbosity=2).run(unittest.TestSuite(SUITE))
def test_dummy():
pass

0 comments on commit 2f7ada9

Please sign in to comment.