Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test number of total sources and split up by publication. #73

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arjunsavel
Copy link
Collaborator

Addresses #54.

So far, I've tested the number of sources in the database and the number of sources that correspond to each publication. Anything else we want to add?

@arjunsavel arjunsavel requested a review from kelle August 14, 2024 15:48
Copy link
Contributor

@kelle kelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is testing the contents of the database and I think should be in a different test module. looking at SIMPLE, it makes sense to have one test module per table. So maybe this should be in test_sources.py.

tests/test_database.py Outdated Show resolved Hide resolved
@arjunsavel arjunsavel requested a review from kelle August 15, 2024 13:58
@kelle
Copy link
Contributor

kelle commented Oct 22, 2024

I think we should also check for the total number of sources.

Copy link
Contributor

@kelle kelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Make a conftest.py
  • in test_sources, also test total number of sources.

@@ -16,6 +16,9 @@
from astrodbkit2.astrodb import or_
import numpy as np


###### now, we test database functionality, self-consistency, etc. #####

def test_setup_db(db):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In SIMPLE, I use a conftest.py to do these type of things.

db.Sources.c.reference == reference,

)
).astropy()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be able to use .count() or similar instead of getting a table output


from sqlalchemy import and_, or_
import pytest
from astropy.io.votable.ucd import check_ucd, parse_ucd, UCDWords
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these imports are used

@kelle
Copy link
Contributor

kelle commented Oct 22, 2024

Move test_coordinates test from test_database into test_sources.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants