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

Freeze when setting project data on window #183

Closed
rwols opened this issue May 3, 2020 · 4 comments
Closed

Freeze when setting project data on window #183

rwols opened this issue May 3, 2020 · 4 comments

Comments

@rwols
Copy link
Contributor

rwols commented May 3, 2020

The following freezes Sublime Text 4074:

class Foo(unittest.TestCase):

    def test_foo(self):
        w = sublime.active_window()
        w.set_project_data({'settings': {'a': 'b'}})
@rwols
Copy link
Contributor Author

rwols commented May 3, 2020

Looks like I can use unittesting.mock.MagicMock for my purposes.

w = sublime.active_window()
w.project_data = MagicMock(return_value={'settings': {'a': 'b'}})

@randy3k
Copy link
Member

randy3k commented May 3, 2020

I cannot actually reproduce it. How did you run the test?

@rwols
Copy link
Contributor Author

rwols commented May 3, 2020

My setup was:

  • Clone the LSP repo https://github.com/sublimelsp/LSP/
  • Have a .sublime-project active that includes LSP as folder
  • Open tests/test_configurations.py
  • Paste the above test into the file (and add import sublime)
  • Run "UnitTesting: Test Current File"

@rwols
Copy link
Contributor Author

rwols commented Jun 7, 2020

Cannot reproduce.

@rwols rwols closed this as completed Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants