CloverHealth / pytest-pgsql

Clean PostgreSQL Databases for Your Tests
http://pytest-pgsql.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
65 stars 4 forks source link

No Usage Examples #7

Open Californian opened 6 years ago

Californian commented 6 years ago

There are no complete usage examples here. How do I use this, e.g., with sqlalchemy and alembic? Can models automatically be registered, or do they need to be individually created in tests?

dargueta commented 6 years ago

Can you give us an example of some code you'd like to test (not the unit test code) and maybe we can work with that?

dantimofte commented 5 years ago

I'm also interested in examples.

Could you write some test for this project : https://github.com/biofreack/data_scrapper

Alembic is in https://github.com/biofreack/crypto_database

I think the project is simple enough and writing the tests shouldn't take too long if know how .

dargueta commented 5 years ago

Could you write some test for this project : https://github.com/biofreack/data_scrapper

From what I can tell, that project is a webpage scraper and uses the database only for dumping data it's pulled from coinmarketcap.com. It doesn't do anything database-related aside from storage.

That's also really project-specific. I was hoping for a more general example.

dantimofte commented 5 years ago

Could you write some test for this project : https://github.com/biofreack/data_scrapper

From what I can tell, that project is a webpage scraper and uses the database only for dumping data it's pulled from coinmarketcap.com. It doesn't do anything database-related aside from storage.

That's also really project-specific. I was hoping for a more general example.

i wanted something like this : gist

michaelfresco commented 5 years ago

The book Essential SQLAlchemy has a really nice example with unittest. Something like this would be extremely interesting.

https://github.com/oreillymedia/essential-sqlalchemy-2e/tree/master/ch04