question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi, I’m trying to integrate green into my django tests. Usually after the second test i use the –keepdb argument from command line to save time. I was wondering how can i pass this argument using green, I tried adding this into a config file but I receive a parsing error

configparser.ParsingError: Source contains parsing errors: '<???>'
	[line  2]: '--keepdb\n'

What is the correct way?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
CleanCutcommented, Oct 25, 2017

Found it. I won’t be able to issue a new release until tonight, but if you would like to hot-patch your local installation of green, here’s the diff:

diff --git a/green/djangorunner.py b/green/djangorunner.py
index bdb057b..548e52d 100644
--- a/green/djangorunner.py
+++ b/green/djangorunner.py
@@ -75,7 +75,7 @@ try:

         def __init__(self, verbosity=-1, **kwargs):

-            super(DjangoRunner, self).__init__()
+            super(DjangoRunner, self).__init__(**kwargs)
             self.verbosity = verbosity
             self.loader = GreenTestLoader()

@@ -87,6 +87,7 @@ try:
                     help="""
                     Green verbosity level for tests.  Value should be an integer
                     that green supports.  For example: --green-verbosity 3""")
+            super(DjangoRunner, cls).add_arguments(parser)

         def run_tests(self, test_labels, extra_tests=None, **kwargs):
             """
0reactions
CleanCutcommented, Oct 26, 2017

Thanks, I appreciate it!

Also, thank you for reporting a valid bug! If you would like a free code to my Python Testing with Green course on Udemy, then just let me know what email address you would like me to send the code to. (You can send an email to nathan.stocks@gmail.com if you want the code but don’t want to post your email address publicly on github).

Read more comments on GitHub >

github_iconTop Results From Across the Web

URL dispatcher - Django documentation
The keyword arguments are made up of any named parts matched by the path expression that are provided, overridden by any arguments specified...
Read more >
Django url parameters, extra options & query strings
Url parameters can capture any part of a url, whether it's a string, a number or a special set of characters that has...
Read more >
Capturing URL parameters in request.GET - django
When a URL is like domain/search/?q=haha , you would use request.GET.get('q', '') . q is the parameter you want, and '' is the...
Read more >
Working with URL, GET, POST parameters in Django
This tutorial tries to clarify on how one can pass parameters from one page to another page in Django. I follow three ways:...
Read more >
Get parameters passed by urls in Django - GeeksforGeeks
Get parameters passed by urls in Django ; author = models.CharField(max_length = 20 ). content = models.TextField() ; path("articles / < id >...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found