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_python_dispatch fails under pytest #62501

Open
zou3519 opened this issue Jul 30, 2021 · 4 comments · May be fixed by #62684
Open

test_python_dispatch fails under pytest #62501

zou3519 opened this issue Jul 30, 2021 · 4 comments · May be fixed by #62684

Comments

@zou3519
Copy link
Contributor

@zou3519 zou3519 commented Jul 30, 2021

🐛 Bug

--- Logging error ---
Traceback (most recent call last):
  File "/scratch/rzou/pt/workspace-env/lib/python3.7/logging/__init__.py", line 1025, in emit
    msg = self.format(record)
  File "/scratch/rzou/pt/workspace-env/lib/python3.7/logging/__init__.py", line 869, in format
    return fmt.format(record)
  File "/scratch/rzou/pt/workspace-env/lib/python3.7/site-packages/_pytest/logging.py", line 65, in format
    return super().format(record)
  File "/scratch/rzou/pt/workspace-env/lib/python3.7/logging/__init__.py", line 608, in format
    record.message = record.getMessage()
  File "/scratch/rzou/pt/workspace-env/lib/python3.7/logging/__init__.py", line 369, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/raid/rzou/pt/workspace-env/bin/pytest", line 11, in <module>

To Reproduce

pytest test/test_python_dispatch.py -v

@Krystal225
Copy link

@Krystal225 Krystal225 commented Aug 3, 2021

Mixing different format functions.

The old-style % formatting uses % codes for formatting:

'It will cost $%d Rupees.' % 100

The new-style {} formatting uses {} codes and the .format method

'It will cost ${0} Rupees.'.format(100)

Note that with old-style formatting, you have to specify multiple arguments using a tuple:

'%d days and %d nights' % (40, 40)
@zou3519
Copy link
Contributor Author

@zou3519 zou3519 commented Aug 3, 2021

@Krystal225 do you have a proposed fix?

@Krystal225 Krystal225 linked a pull request that will close this issue Aug 3, 2021
@Krystal225
Copy link

@Krystal225 Krystal225 commented Aug 5, 2021

@zou3519 can you review my PR and correct errors (if any) please.

@goelm08
Copy link

@goelm08 goelm08 commented Aug 19, 2021

Hello, I am a beginner and I want to contribute to this project. Can you please help me to get started?

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

Successfully merging a pull request may close this issue.

4 participants