Commit 1274ada6 authored by Stephen Thompson's avatar Stephen Thompson

Issue #1 fixed test style

parent ee847413
Pipeline #3781 passed with stages
in 7 minutes and 23 seconds
......@@ -2,21 +2,20 @@
"""scikit-surgery-evaluation tests"""
import pytest
# Pytest style
def test_requirements_vs_setup():
"""
Test that the requirements file matches setup.py
Test that the requirements.txt matches setup.py
"""
# setup=open("setup.py","r")
# setuptxt = setup.read()
# setup.close()
with open("setup.py", "r") as f:
searchlines=f.readlines()
with open("setup.py", "r") as file_to_read:
searchlines = file_to_read.readlines()
install_line = -1
for i, line in enumerate(searchlines):
if "install_requires" in line:
......@@ -33,22 +32,20 @@ def test_requirements_vs_setup():
for line in searchlines[install_line + 1: end_line]:
req = line.replace(',', '').replace("'", "")
req = req.replace(' ', '').replace('\n','')
req = req.replace(' ', '').replace('\n', '')
setup_reqs.append(req)
with open("requirements.txt","r") as f:
searchlines=f.readlines()
with open("requirements.txt", "r") as file_to_read:
searchlines = file_to_read.readlines()
reqs = []
for line in searchlines:
if "#" not in line:
reqs.append(line.replace('\n',''))
reqs.append(line.replace('\n', ''))
for setup_req in setup_reqs:
assert setup_req in reqs
for req in reqs:
assert req in setup_reqs
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment