diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 61de40e28..01418af19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,11 +38,11 @@ jobs: pip install -r requirements.txt - name: Run tests - run: pytest + run: python -m pytest env: # The hostname, username used to communicate with the PostgreSQL service container POSTGRES_HOST: localhost VC_DB_USER: postgres POSTGRES_PORT: 5432 DJANGO_DEV: 1 - GH_TOKEN: 1 \ No newline at end of file + GH_TOKEN: 1 diff --git a/.travis.yml b/.travis.yml index 41fcc48ae..e0f5a631a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_script: script: - ./manage.py collectstatic - - pytest + - python -m pytest notifications: email: false @@ -27,4 +27,4 @@ notifications: - https://webhooks.gitter.im/e/b119fa557626081e1f36 on_success: change # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always - on_start: never # options: [always|never|change] default: always \ No newline at end of file + on_start: never # options: [always|never|change] default: always diff --git a/README.rst b/README.rst index d9d01bc22..d328634c9 100644 --- a/README.rst +++ b/README.rst @@ -206,7 +206,7 @@ Run Tests Use these commands to run code style checks and the test suite:: black -l 100 --check . - DJANGO_DEV=1 pytest + DJANGO_DEV=1 python -m pytest Data import diff --git a/vulnerabilities/importers/nginx.py b/vulnerabilities/importers/nginx.py index e74577f98..19955af07 100644 --- a/vulnerabilities/importers/nginx.py +++ b/vulnerabilities/importers/nginx.py @@ -66,7 +66,7 @@ def updated_advisories(self): def to_advisories(self, data): advisories = [] - soup = BeautifulSoup(data) + soup = BeautifulSoup(data, features="lxml") vuln_list = soup.select("li p") # Example value of `vuln_list` : diff --git a/vulnerabilities/importers/postgresql.py b/vulnerabilities/importers/postgresql.py index 53961e994..fe45f4f7b 100644 --- a/vulnerabilities/importers/postgresql.py +++ b/vulnerabilities/importers/postgresql.py @@ -58,7 +58,7 @@ def updated_advisories(self): def to_advisories(data): advisories = [] - soup = BeautifulSoup(data) + soup = BeautifulSoup(data, features="lxml") table = soup.select("table")[0] for row in table.select("tbody tr"): ref_col, affected_col, fixed_col, severity_score_col, desc_col = row.select("td") diff --git a/vulnerablecode/urls.py b/vulnerablecode/urls.py index 464a05254..ad8f2ce23 100644 --- a/vulnerablecode/urls.py +++ b/vulnerablecode/urls.py @@ -88,7 +88,7 @@ def __init__(self, *args, **kwargs): urlpatterns = [ path("admin/", admin.site.urls), path("api/schema/", SpectacularAPIView.as_view(), name="schema"), - path("api/schema/swagger-ui/", SpectacularSwaggerView.as_view(), name="swagger-ui"), + path("api/docs", SpectacularSwaggerView.as_view(), name="swagger-ui"), path("packages/search", PackageSearchView.as_view(), name="package_search"), path("packages/", PackageUpdate.as_view(), name="package_view"), path("vulnerabilities/", VulnerabilityDetails.as_view(), name="vulnerability_view"),