[Mailman-Developers] Re: which database is used in unittest?

2021-01-23 Thread baguazhangba
good point, thanks Abhilash!
Mike
___
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-le...@python.org
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3

Security Policy: https://wiki.list.org/x/QIA9


[Mailman-Developers] Re: which database is used in unittest?

2021-01-23 Thread Abhilash Raj


On Thu, Jan 21, 2021, at 10:38 AM, baguazhan...@gmail.com wrote:
> Thanks Mark!
> We don't want to leave artifacts behind but want to see the testing 
> data in the db before it wipes about. The goal is to see if we can 
> write some data to another database. 

The test suite doesn’t just wipe data at the end of the test run, it will
clean up after each set of tests to make sure that they can expect a
clean slate when running. So, you won’t be able to simply skip the
deletion at the end of the run and expect some data in the database.

You can instead create lists and data by running a dev server locally
and the inspect the database.

> thanks!
> Mike
> ___
> Mailman-Developers mailing list -- mailman-developers@python.org
> To unsubscribe send an email to mailman-developers-le...@python.org
> https://mail.python.org/mailman3/lists/mailman-developers.python.org/
> Mailman FAQ: https://wiki.list.org/x/AgA3
> 
> Security Policy: https://wiki.list.org/x/QIA9
>

-- 
  thanks,
  Abhilash Raj (maxking)
___
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-le...@python.org
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3

Security Policy: https://wiki.list.org/x/QIA9


[Mailman-Developers] Re: which database is used in unittest?

2021-01-21 Thread baguazhangba
Thanks Mark!
We don't want to leave artifacts behind but want to see the testing data in the 
db before it wipes about. The goal is to see if we can write some data to 
another database. 

thanks!
Mike
___
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-le...@python.org
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3

Security Policy: https://wiki.list.org/x/QIA9


[Mailman-Developers] Re: which database is used in unittest?

2021-01-04 Thread Mark Sapiro
On 1/3/21 7:51 PM, baguazhan...@gmail.com wrote:
> Thanks Mark for the answer! 
> Now I'm able to  use MAILMAN_EXTRA_TESTING_CFG=/tmp/mailman/sqilite.db 
> python3 -m nose2 -v mailman.model.test
> and can see the file timestamp changed after I run unittest.
> 
> but the sqlite database seems empty when I query tables like select * from 
> mailinglist;
> I tried sys.exit() right after calling create_list('a...@example.com') and 
> config.db.store.flush(), but still could not see any data in sqlite.  
> anywhere I should look at?



Testing clears out everything it does. See
.

Would you really want testing to leave artifacts behind?

What is your actual goal?

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
___
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-le...@python.org
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3

Security Policy: https://wiki.list.org/x/QIA9


[Mailman-Developers] Re: which database is used in unittest?

2021-01-03 Thread baguazhangba
Thanks Mark for the answer! 
Now I'm able to  use MAILMAN_EXTRA_TESTING_CFG=/tmp/mailman/sqilite.db python3 
-m nose2 -v mailman.model.test
and can see the file timestamp changed after I run unittest.

but the sqlite database seems empty when I query tables like select * from 
mailinglist;
I tried sys.exit() right after calling create_list('a...@example.com') and 
config.db.store.flush(), but still could not see any data in sqlite.  anywhere 
I should look at?

thanks!
Mike
___
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-le...@python.org
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3

Security Policy: https://wiki.list.org/x/QIA9


[Mailman-Developers] Re: which database is used in unittest?

2021-01-03 Thread Mark Sapiro
On 1/3/21 5:22 PM, Mark Sapiro wrote:
> 
> Tests run that way will use their own sqlite DB which is removed after
> testing. You can use any database you like by configuring it in a file
> containing a [database] section with appropriate class and url
> definitions and then doing something like
> 
>> MAILMAN_EXTRA_TESTING_CFG=/path/to/db/config python3 -m nose2 -v 
>> mailman.model.test


For more on this see
.


-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
___
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-le...@python.org
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3

Security Policy: https://wiki.list.org/x/QIA9


[Mailman-Developers] Re: which database is used in unittest?

2021-01-03 Thread Mark Sapiro
On 1/3/21 4:44 PM, baguazhan...@gmail.com wrote:
> Hello All,
> 
> Happy New Year 2021!
> I've configured mailman using sqlite as backend database. but when I run 
> unittests, 
> e.g. python3 -m nose2 -v mailman.model.test
> 
> seems the data is not write to production sqlite database, so which database 
> is used in unittest and how to check data in that db?


Tests run that way will use their own sqlite DB which is removed after
testing. You can use any database you like by configuring it in a file
containing a [database] section with appropriate class and url
definitions and then doing something like

> MAILMAN_EXTRA_TESTING_CFG=/path/to/db/config python3 -m nose2 -v 
> mailman.model.test

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
___
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-le...@python.org
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3

Security Policy: https://wiki.list.org/x/QIA9