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.

Test in camelcase won't run

See original GitHub issue

Describe the bug Test won’t run if name of test is in camelcase.

18:57:48 | INFO | MainThread | logging.py:create_logger:98 | Logger created
18:57:48 | DEBUG | MainThread | __init__.py:__init__:41 | Handler created
18:57:48 | DEBUG | Thread-1 | __init__.py:_handle_coroutine:57 | Starting job with group update_positions
18:57:48 | INFO | Thread-1 | tracker.py:_async_update:52 | Updating positions in test_token.py
18:57:48 | DEBUG | Thread-1 | file.py:parse_file_structure:22 | Converted pattern {'test': ['\\v^\\s*%(async )?def (test_\\w+)'], 'namespace': ['\\v^\\s*class (\\w+)']} to {'test': [re.compile('^\\s*(?:async )?def (test_\\w+)')], 'namespace': [re.compile('^\\s*class (\\w+)')]}
18:57:48 | DEBUG | Thread-1 | tracker.py:_async_update:79 | New test test_token.py found in test_token.py
18:57:48 | DEBUG | Thread-1 | tracker.py:_remove_old_positions:122 | No tests removed
18:57:48 | DEBUG | Thread-1 | __init__.py:_handle_coroutine:77 | Finished job with group update_positions
18:57:52 | INFO | MainThread | __init__.py:run_nearest:125 | Running nearest test in test_token.py at line 0
18:57:58 | INFO | MainThread | __init__.py:run_nearest:125 | Running nearest test in test_token.py at line 1

I am using djangotest as the python runner

To Reproduce Create a test, and name it with camelcase in a django project, and try to run it. For example: This won’t run.

def testSomething:
    self.assertEqual(True, True)

This will run

def test_something:
    self.assertEqual(True, True)

Expected behavior As it runs as expected with vim-test, I would expect it to be run with vim-ultest as well.

Also while I am here, I have a simple question as well: Is it possible to clear the icons after running tests? Couldn’t figure out how to do this

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sebljcommented, May 19, 2021

Works great! Thanks!

1reaction
rcarrigacommented, May 18, 2021

Haha that’s very fair, we all have to live with some sketchy code bases!

And yep can do, I will close this issue when it’s in

Read more comments on GitHub >

github_iconTop Results From Across the Web

Converting any string into camel case - Stack Overflow
To get camelCase. ES5 var camalize = function camalize(str) { return str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, function(match, chr) { return chr.
Read more >
The camelcase rule does not allow leading/trailing ... - GitHub
What did you expect to happen? I would have expected it to allow the variable name based on the camelcase docs docs quoted...
Read more >
Discuss CamelCase Method - Codewars
camelCase method (`camel_case` function in PHP, `CamelCase` in C# or `camelCase` ... I run the same source code many times and I got...
Read more >
What is the CamelCase naming convention? - TechTarget
CamelCase is a way to separate the words in a phrase by making the first letter of each word capitalized and not using...
Read more >
Camel case vs. snake case: What's the difference?
Camel case and snake case stand at opposite ends of the variable naming convention spectrum. When multiple words are used to form a...
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