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

AboutStrings: Unclear testing purpose #262

Open
LizBroadbridge opened this issue Oct 16, 2022 · 3 comments
Open

AboutStrings: Unclear testing purpose #262

LizBroadbridge opened this issue Oct 16, 2022 · 3 comments

Comments

@LizBroadbridge
Copy link

In the 'AboutStrings' test class there's a test called 'test_use_single_quotes_to_create_string_with_double_quotes'. I found it unclear what the purpose of this test was. It seemed like I had to rewrite the string out which didn't make much sense to me, since it meant I was comparing itself to itself. The same goes for the following test called 'test_use_double_quotes_to_create_strings_with_single_quotes'. I found the other questions useful, so if these two could be changed to match a similar pattern to the rest that would be great.

@v-aryan
Copy link

v-aryan commented Jan 30, 2023

Hey @LizBroadbridge , Can you explain this in much more simplified way, what has to be done !

@v-aryan
Copy link

v-aryan commented Jan 30, 2023

def test_use_single_quotes_to_create_string_with_double_quotes(self):
    string = 'He said, "Go Away."'
    self.assertEqual(__, string)

def test_use_double_quotes_to_create_strings_with_single_quotes(self):
    string = "Don't"
    self.assertEqual(__, string)

did you mean to merge both the strings under one ?

@HeavenEvolved
Copy link

I don't understand the issue, what you write is supposed to be equal to itself. Do you want to do something like the following?:

        a = 'He said, "Go Away"'
        b = """He said, "Go Away"""
        self.assertEqual(__, (a == b))

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

3 participants