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

[Bug] Python 3.12 and 3.11 do not produce the same report #968

Closed
d0b3rm4n opened this issue Oct 9, 2023 · 4 comments · Fixed by #970
Closed

[Bug] Python 3.12 and 3.11 do not produce the same report #968

d0b3rm4n opened this issue Oct 9, 2023 · 4 comments · Fixed by #970
Labels
bug Something isn't working
Milestone

Comments

@d0b3rm4n
Copy link

d0b3rm4n commented Oct 9, 2023

What happened?

The following example:

# robocop: disable=missing-doc-suite,missing-doc-test-case
*** Test Cases ***
Test Unused Var         
    ${used_var}    Set Variable    foo
    IF    $used_var == "foo"
        Log    "Is foo"
    ELSE
        Fail    "Is not foo"
    END

Reports under Python 3.12.0:

ugreport.robot:4:5 [I] 0920 Variable '${used_var}' is assigned but not used (unused-variable)

Under Python 3.11.4 this is not reported.

Not sure but it might be related to the changes mentioned in robotframework/robotframework#4771 and python/cpython#104802.

What command/code did you try to run?

Robotframework versions

pip list |grep robo
robotframework          6.1.1
robotframework-requests 0.9.5
robotframework-robocop  4.1.1

Python Versions:

python --version
Python 3.12.0

Robocop command:

robocop --reports all bugreport.robot
bugreport.robot:4:5 [I] 0920 Variable '${used_var}' is assigned but not used (unused-variable)

Processed 1 file from which 1 file contained issues.

Found 1 issue: 1 INFO.

Report generated by Robocop version: 4.1.1

Issues by ID:
I0920 (unused-variable) : 1

Scan finished in 0.006s.

Reported: 2023-10-09 16:44:51 +0300

Robot command:

robot bugreport.robot
==============================================================================
Bugreport                                                                     
==============================================================================
Test Unused Var                                                       | PASS |
------------------------------------------------------------------------------
Bugreport                                                             | PASS |
1 test, 1 passed, 0 failed
==============================================================================
Output:  ./output.xml
Log:     ./log.html
Report:  ./report.html

What is the full error message?

bugreport.robot:4:5 [I] 0920 Variable '${used_var}' is assigned but not used (unused-variable)

What did you expect to happen instead?

I expect it to not report anything like with Python 3.11.x

Robotframework versions

pip list | grep robot
robotframework         6.1.1
robotframework-robocop 4.1.1

Python Versions:

python --version
Python 3.11.4

Robocop command:

robocop --reports all bugreport.robot 

Processed 1 file but no issues were found.

Found 0 issues.

Report generated by Robocop version: 4.1.1

Issues by ID:
No issues found.

Scan finished in 0.007s.

Reported: 2023-10-09 16:48:36 +0300

Robot command:

robot bugreport.robot
==============================================================================
Bugreport                                                                     
==============================================================================
Test Unused Var                                                       | PASS |
------------------------------------------------------------------------------
Bugreport                                                             | PASS |
1 test, 1 passed, 0 failed
==============================================================================
Output:  ./output.xml
Log:    ./log.html
Report:  ./report.html

Operating System

Linux

Robocop version

4.1.1

@d0b3rm4n d0b3rm4n added the bug Something isn't working label Oct 9, 2023
@bhirsz
Copy link
Member

bhirsz commented Oct 9, 2023

Thanks for the report. It indeed looks connected to the linked issue from the RF.

Edited - I was under wrong impression since we fully implemented it on our side, we just have the same bug as Robot Framework had. I will fix it.

@bhirsz
Copy link
Member

bhirsz commented Oct 9, 2023

We should add Python 3.12 to our CI/CD, thanks for the reminder.

@bhirsz
Copy link
Member

bhirsz commented Oct 23, 2023

Released in 4.2.0

@bhirsz bhirsz added this to the 4.2.0 milestone Oct 23, 2023
@d0b3rm4n
Copy link
Author

thx, I can confirm 4.2.0 works with Python 3.12. The issues it reported in our code are not reported any longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants